package mail.claux.com;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class RiepilogoMailActivity extends Activity {
	/**
     * Called with the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.riepilogo);
        
        final Button ok = (Button) this.findViewById(R.id.ok_button);
        //impostazione TextView per recupero dati form
        final TextView from = (TextView) this.findViewById(R.id.text_from);
        final TextView to = (TextView) this.findViewById(R.id.text_to);
        final TextView subject = (TextView) this.findViewById(R.id.text_subject);
        final TextView body = (TextView) this.findViewById(R.id.text_body);
        
        //recupero dati form e stampa a video
        Bundle bundle = this.getIntent().getExtras();
        from.setText(bundle.getString("from"));
        to.setText(bundle.getString("to"));
        subject.setText(bundle.getString("subject"));
        body.setText(bundle.getString("body"));
        
      //ClickListener associato al button "OK"
        ok.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                //memorizza i dati nel DB SQLite
            	/*
            	 ***********
            	 */

            	//ritorna all'activity principale (SendMailActivity)
            	Intent sendmail_intent = new Intent(getApplicationContext(),SendMailActivity.class);
                startActivity(sendmail_intent);
                //e termina l'activity corrente
                RiepilogoMailActivity.this.finish();
            }
        });
    }
}
